package cn.com.nes.site.entity.vo.crm;

import cn.com.nes.mybatis.agent.crm.entity.Clue;
import cn.com.nes.site.entity.vo.BaseVO;
import cn.hutool.core.util.StrUtil;
import lombok.Data;

import javax.validation.constraints.NotNull;


/**
 * 新增、修改线索
 */
@Data
public class SaveUpdateClueVo extends BaseVO {
    /**
     * 线索id
     */
    private String uuid;

    /**
     * 线索阶段 新线索    明确意向（产生了沟通确定了购买意愿） 加微信  转商机   无效
     */
    private String clueStage;

    /**
     * 跟进状态  待跟进  跟进中 跟进结束（转商机或无效）
     */
    private String followupStatus;

    /**
     * 入池方式：自动落入 退回  回收   导入  录入
     */
    private String poolEntryMode;

    /**
     * 线索流量来源：今日头条  西瓜 抖音 朋友介绍
     */
    private String clueSource;

    /**
     * 流量来源关联广告id
     */
    private String advertisementId;

    /**
     * 是否认领 1是 0否
     */
    private String isRl;

    /**
     * 线索状态：已分配  待分配
     */
    private String culeState;

    /**
     * 线索所有人：（登记人）
     */
    private String clueOwner;

    /**
     * 线索名称
     */
    private String clueName;

    /**
     * 企业名称
     */
    private String clueCompany;

    /**
     * 企业联系人
     */
//    @NotNull(message = "企业联系人")
    private String companyContact = StrUtil.EMPTY;

    /**
     * 线索手机号
     */
    @NotNull(message = "线索手机号")
    private String cluePhone;

    /**
     * 线索手机号  旧
     */
    private String oldCluePhone;

    /**
     * 号码归属地
     */
    private String numberHome;

    /**
     * 企业备注
     */
    private String companyMemo;

    /**
     * 企业身份：设备购买 售后维修  项目洽谈
     */
    private String poolType;

    /**
     * 联系人职务
     */
    private String personPost;

    /**
     * 业务方向(多选)
     */
    private String businessDirection;

    /**
     * 项目名称
     */
    private String projectName;

    /**
     * 项目负责人
     */
    private String personInCharge;

    /**
     * 项目地址
     */
    private String projectAddress;

    /**
     * 负责人电话
     */
    private String personPhone;

    /**
     * 行政区划
     */
    private String xzqhdm;

    /**
     * 经度
     */
    private Double longitude;

    /**
     * 纬度
     */
    private Double latitude;

    /**
     * 性别 01男02女
     */
    private String sex;

    /**
     * 微信
     */
    private String wechat;

    /**
     * 项目面积
     */
    private Double projectArea;

    /**
     * 小程序统一id
     */
    private String unionId;

    /**
     * openid
     */
    private String openId;

    /**
     * 线索所属公司
     */
    private String clueBelongToCompany;

    private String otherData;

    /**
     * 扩展数据
     */
    private String jsonData = StrUtil.EMPTY_JSON;

    /**
     * 模板ID
     */
    private String templateId;

    /**
     * 客户所在地
     */
    private String customerAddress;

    /**
     * 客户经纬度
     */
    private Double customerJd;

    /**
     * 客户经纬度
     */
    private Double customerWd;

    /**
     * 新村商城预约id
     */
    private String newshopBookingId;

    
    public Clue convertToClue(){
        Clue clue = new Clue();
        clue.setUuid(this.getUuid());
        clue.setClueStage(this.getClueStage());
        clue.setFollowupStatus(this.getFollowupStatus());
        clue.setPoolEntryMode(this.getPoolEntryMode());
        clue.setClueSource(this.getClueSource());
        clue.setAdvertisementId(this.getAdvertisementId());
        clue.setCuleState(this.getCuleState());
        clue.setClueOwner(this.getClueOwner());
        clue.setClueName(this.getClueName());
        clue.setClueCompany(this.getClueCompany());
        clue.setCompanyContact(this.getCompanyContact());
        clue.setCluePhone(this.getCluePhone());
        clue.setNumberHome(this.getNumberHome());
        clue.setCompanyMemo(this.getCompanyMemo());
        clue.setPoolType(this.getPoolType());
        clue.setPersonPost(this.getPersonPost());
        clue.setBusinessDirection(this.getBusinessDirection());
        clue.setProjectName(this.getProjectName());
        clue.setPersonInCharge(this.getPersonInCharge());
        clue.setProjectAddress(this.getProjectAddress());
        clue.setPersonPhone(this.getPersonPhone());
        clue.setXzqhdm(this.getXzqhdm());
        clue.setLongitude(this.getLongitude());
        clue.setLatitude(this.getLatitude());
        clue.setSex(this.getSex());
        clue.setWechat(this.getWechat());
        clue.setProjectArea(this.getProjectArea());
        clue.setUnionId(this.getUnionId());
        clue.setOpenId(this.getOpenId());
        clue.setClueBelongToCompany(StrUtil.isNotEmpty(this.getClueBelongToCompany())?this.getClueBelongToCompany():this.getOperateUserCompanyId());
        clue.setOtherData(this.getOtherData());
        clue.setJsonData(this.getJsonData());
        clue.setTemplateId(this.getTemplateId());
        clue.setCustomerAddress(this.getCustomerAddress());
        clue.setCustomerJd(this.getCustomerJd());
        clue.setCustomerWd(this.getCustomerWd());
        clue.setNewshopBookingId(this.getNewshopBookingId());
        clue.setCreateUid(this.getOperateUserId());
        clue.setCreateTime(this.getOperateDate());
        clue.setModifyUid(this.getOperateUserId());
        clue.setModifyTime(this.getOperateDate());
        return clue;
    }
    
}
